import { observe } from "./observe"

function reactive(data, key, value) {
  observe(value)
  Object.defineProperty(data, key, {
    get() {
      console.log('响应式获取:' + value)
      return value
    },
    set(val) {
      if (val !== value) {
        console.log('响应式设置:' + val)
        value = val
      }
    }
  })
}

export {
  reactive
}
